Skip to content

fix(web): parse v1 video pack runtime at compile time - #1614

Merged
kk-agent merged 2 commits into
mainfrom
cursor/fix-v1-pack-runtime-fe1a
Sep 2, 2026
Merged

fix(web): parse v1 video pack runtime at compile time#1614
kk-agent merged 2 commits into
mainfrom
cursor/fix-v1-pack-runtime-fe1a

Conversation

@groupthinking

@groupthinking groupthinking commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Closes #1613

Canonical issue

Closes #1613

GitHub issue create returned 403 from this agent (same as #1612). #1613 is the open concrete issue for anonymous pack emit.

Outcome

next build can statically parse apps/web/src/app/api/v1/video/pack/route.ts. Anonymous POST /api/video/pack and POST /api/v1/video/pack emit hashed Video Pack v0 with source_url + source_hash even without a transcript.

Scope

  • Included:
    • Literal export const runtime = 'nodejs' on the v1 pack route (no export { POST, runtime })
    • Shared handleIdentityPackPost in apps/web/src/lib/video-pack.ts
    • Both pack routes call that handler
    • Source-format regression test for the Next route-segment-config parse rule
  • Explicitly excluded:
    • Qwen / Qwen3.8-27B
    • Hyperframes / forge / slingshot / reach / ClipToAction / Origin tmp uvai
    • Root package-lock.json refresh (pre-existing Docker npm ci drift; see Verification)

Risk

  • Risk level: low
  • Failure mode: if the shared handler regresses, both pack URLs fail the same way. Fail-closed still rejects packs without source_url / source_hash.
  • Rollback: revert this PR; v1 alias returns to the fix: ungate anonymous Video Pack v0 emit on paste-URL #1612 re-export that fails next build.

Verification

Head: 35354080e

Anonymous POST on the READY preview (after Vercel share cookie; deployment protection is on):

POST /api/video/pack → 200
POST /api/v1/video/pack → 200
version=v0 video_id=jNQXAC9IVRw
source_url=https://www.youtube.com/watch?v=jNQXAC9IVRw
source_hash=97150a5c21eef3d12a4543ce2108ca28fd6f829db1da120d7e75655ab471f97d
transcript.full_text=cite:youtube:jNQXAC9IVRw

Production evidence

  • Live uvai.io still serves production deploy dpl_5MgMTeTHqi5YLnVY4moMW3pbM69i (5ccbdf763 / feat: emit hashed Video Pack v0 from paste-URL #1609). Anonymous POST https://uvai.io/api/video/pack and /api/v1/video/pack return 401 {"error":"Authentication required"}.
  • Production deploy of fix: ungate anonymous Video Pack v0 emit on paste-URL #1612 (dpl_8DufAGnGcZg29oQk6ymKBk8FQKao, 25b4de455) is ERROR (route-segment-config parse). uvai.io aliases (uvai.io, www.uvai.io) did not move.
  • This branch's preview is READY and emits the CoS pack JSON. Production will move when this PR is squash-merged to main (v0-uvai production auto-deploy). This agent cannot merge (GitHub 403) and cannot vercel promote (CLI has no stored credentials).

Agent handoff

  • One canonical issue is linked (Closes #1613)
  • No competing PR implements the same issue
  • Preview CoS emit verified
  • uvai.io not yet on this commit — needs human squash-merge of fix(web): parse v1 video pack runtime at compile time #1614 (or vercel promote dpl_7S2b33hZkCQtRceTG2746ZGQVrQ7)
  • Human decision requested: merge/promote to production uvai.io
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 2, 2026 22:38
Next cannot statically parse re-exported `runtime` from the v1 pack
alias, which failed v0-uvai `next build` after #1612. Declare a literal
runtime and call the shared identity-pack POST handler instead.

Co-authored-by: Hayden <groupthinking@users.noreply.github.com>
Co-authored-by: Hayden <groupthinking@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 2, 2026 22:39
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 5f8b09a2-dc0c-459a-af1f-5df639e80a76


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
v0-uvai Ready Ready Preview, v0 Sep 2, 2026 10:40pm UTC

@github-actions github-actions Bot added documentation Improvements or additions to documentation javascript Pull requests that update javascript code tests labels Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 3535408.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The core compile fix is correct; the remaining test and documentation findings are non-blocking.

Pull request overview

Fixes Next.js static parsing for the v1 Video Pack route while preserving anonymous pack generation.

Changes:

  • Declares literal Node.js runtimes for both routes.
  • Extracts shared identity-pack handling.
  • Adds regression coverage for route configuration.
File summaries
File Description
src/youtube_extension/videopack/PLAN.md Updates implementation plan and verification evidence.
apps/web/src/lib/video-pack.ts Hosts the shared POST handler.
apps/web/src/app/api/video/pack/route.ts Delegates to the shared handler.
apps/web/src/app/api/v1/video/pack/route.ts Replaces the invalid runtime re-export.
apps/web/src/app/api/v1/video/pack/__tests__/route.test.ts Tests literal runtime configuration and pack output.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

// v0-uvai `next build` after #1612 (`25b4de455`):
// "The exported configuration object in a source file needs to have a
// very specific format from which some properties can be statically parsed"
expect(V1_ROUTE_SOURCE).toMatch(/export const runtime = ['"]nodejs['"]/);
* **Proof Artifact:** Frontend 76 passed (7 files, including emit-video-pack fail-closed). Python 23 passed. Pack JSON locks `source_url` + `source_hash`. Missing either field throws verification failed (not a silent empty UI). Live production still 401 until this branch deploys. Golden hashes unchanged.
* `cd apps/web && npx vitest run src/app/api/v1/video/pack src/app/api/video/pack src/lib/__tests__/video-pack.test.ts src/lib/__tests__/emit-video-pack.test.ts src/lib/__tests__/auth-paths.test.ts`
* `cd apps/web && npm run build`
* **Proof Artifact:** Head `346b276f8`. Vitest 42 passed (5 files). `next build` compiled successfully and listed `ƒ /api/v1/video/pack` and `ƒ /api/video/pack`. No route-segment-config parse error.
@kk-agent
kk-agent merged commit 800cf1e into main Sep 2, 2026
32 of 33 checks passed
@kk-agent
kk-agent deleted the cursor/fix-v1-pack-runtime-fe1a branch September 2, 2026 22:54
@linear-code

linear-code Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

GRV-461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation javascript Pull requests that update javascript code tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix anonymous paste-URL Video Pack v0 emit auth gating

4 participants